<?php 
    include('../includes/db_exe/db_connection.php');
?>

<!-- include phan header -->
<?php
    $title_page = 'Wewant';
    include('../includes/html_templates/header.php');
    $userId = 1; 
?>

<div class="container-fluid outer-static" id="outer" style="margin-top:45px;">
	<div id="inner">
        <div class="clearfix"></div>
        <div class="content-inner with-buttons show-cards">
            <div class="products-grid">
                <div class="products-thumbnails product-card-container">

                <!-- Truy van co so du lieu xuat ra cac san pham ma user follow -->
                <?php
                    $db = connectDb();
                    //lay tat ca thong tin san pham tu bang duoc join giua bang product va bang follows 
                    //dùng id_product va select ra cac dong dung id_user_to la id cua nguoi dung
                    $q = "SELECT p.id_product,p.product_name,p.product_url,p.product_price,p.image_src FROM products AS p";
                    $q .= " INNER JOIN feeds AS fe";
                    $q .= " USING (id_product)";
                    $q .= " WHERE fe.id_user_to = 1";
                    
                    $r = exeQuery($db,$q);
                    while($row = mysqli_fetch_array($r,MYSQLI_ASSOC)) { 
                    ?>
                    
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="Product Detail.html" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src=<?php echo "../upload/image_product/x354-{$row['image_src']}.jpg" ?> >
                                </a>
                                <?php if($row['product_price'] >0) echo "<span class='price-tag'>{$row['product_price']} đ</span>";  ?> <!-- neu price > 0 thi hien span -->
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="love-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card"><?php echo "{$row['product_name']}"; ?></h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>

                    <?php } ?>
                    <!-- ket thuc vong lap cho tung the <span> product card -->
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="Product Detail.html" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src="resources/images_product/1.jpg">
                                </a>
                                <span class="price-tag">150.000 đ</span>
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="love-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card">Áo kháot xòa hfaod hiệu terra cực đẹp và chất đây các bạn</h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="#" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src="resources/images_product/2.jpg">
                                </a>
                                <span class="price-tag">150.000 đ</span>
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="love-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card">Áo kháot xòa hfaod hiệu terra cực đẹp và chất đây các bạn</h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="#" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src="resources/images_product/3.jpg">
                                </a>
                                <span class="price-tag">150.000 đ</span>
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="loved-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card">Áo kháot xòa hfaod hiệu terra cực đẹp và chất đây các bạn</h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="#" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src="resources/images_product/5.jpg">
                                </a>
                                <span class="price-tag">150.000 đ</span>
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="loved-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card">Áo kháot xòa hfaod hiệu terra cực đẹp và chất đây các bạn</h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="#" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src="resources/images_product/4.jpg">
                                </a>
                                <span class="price-tag">150.000 đ</span>
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="love-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card">Áo kháot xòa hfaod hiệu terra cực đẹp và chất đây các bạn</h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="#" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src="resources/images_product/7.jpg">
                                </a>
                                <span class="price-tag">150.000 đ</span>
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="love-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card">Áo kháot xòa hfaod hiệu terra cực đẹp và chất đây các bạn</h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="#" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src="resources/images_product/3.jpg">
                                </a>
                                <span class="price-tag">150.000 đ</span>
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="love-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card">Áo kháot xòa hfaod hiệu terra cực đẹp và chất đây các bạn</h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="#" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src="resources/images_product/1.jpg">
                                </a>
                                <span class="price-tag">150.000 đ</span>
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="love-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card">Áo kháot xòa hfaod hiệu terra cực đẹp và chất đây các bạn</h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="#" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src="resources/images_product/1.jpg">
                                </a>
                                <span class="price-tag">150.000 đ</span>
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="love-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card">Áo kháot xòa hfaod hiệu terra cực đẹp và chất đây các bạn</h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="#" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src="resources/images_product/1.jpg">
                                </a>
                                <span class="price-tag">150.000 đ</span>
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="love-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card">Áo kháot xòa hfaod hiệu terra cực đẹp và chất đây các bạn</h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="#" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src="resources/images_product/1.jpg">
                                </a>
                                <span class="price-tag">150.000 đ</span>
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="love-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card">Áo kháot xòa hfaod hiệu terra cực đẹp và chất đây các bạn</h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="#" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src="resources/images_product/1.jpg">
                                </a>
                                <span class="price-tag">150.000 đ</span>
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="love-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card">Áo kháot xòa hfaod hiệu terra cực đẹp và chất đây các bạn</h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="#" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src="resources/images_product/1.jpg">
                                </a>
                                <span class="price-tag">150.000 đ</span>
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="love-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card">Áo kháot xòa hfaod hiệu terra cực đẹp và chất đây các bạn</h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="#" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src="resources/images_product/1.jpg">
                                </a>
                                <span class="price-tag">150.000 đ</span>
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="love-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card">Áo kháot xòa hfaod hiệu terra cực đẹp và chất đây các bạn</h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="#" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src="resources/images_product/1.jpg">
                                </a>
                                <span class="price-tag">150.000 đ</span>
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="love-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card">Áo kháot xòa hfaod hiệu terra cực đẹp và chất đây các bạn</h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>
                    <span>
                        <div class="product-card card-theme">
                            <div class="all-in-img-product">
                                <a href="#" alt="Con mèo hiệu con chuột" target="_blank" class="product-thumbnail">
                                    <div class="hoverMask"></div>
                                    <img src="resources/images_product/1.jpg">
                                </a>
                                <span class="price-tag">150.000 đ</span>
                            </div>
                            <div class="interacted-product-info">
                                <a href="#" class="love-img-button overtext">
                                    Thích
                                </a>
                                <span class="nums-loved">214</span>                                 
                            </div>
                            <div class="product-card-tile-meta">
                                <a href="#" title="" class="title-card-link" target="_blank">
                                    <h3 class="title-product-card">Áo kháot xòa hfaod hiệu terra cực đẹp và chất đây các bạn</h3>
                                </a>
                            </div>
                            <div class="actionCardUsers">
                                <div class="userItem">
                                    <a href="#" target="_blank">
                                        <img src="resources/images_user/user1.jpg" alt="" class="userImg" />
                                        <div class="userName">Giacatvn</div>
                                        <div class="collectionName">Áo quần bảnh bao</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </span>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</body>
</html>
